/*
 * @Author: xiehangyun 
 * @Date: 2025-05-16 10:34:03 
 * @Last Modified by: xiehangyun
 * @Last Modified time: 2025-05-16 21:10:17
 */

import Api from "src/api/Api";

export interface HotlineItem {
    id: string;
    number: string;
    description: string;
}

export interface FAQItem {
    id: string;
    question: string;
    answer: string;
}

// 客服热线接口
class CustomerServiceApi extends Api {

    constructor() {
        super()
    }

    // 获取客服热线
    getHotlines(): Promise<{ data: HotlineItem[] }> {
        return this._get('/api/hotlines');
    }

    // 获取常见问题
    getFAQs(): Promise<{ data: FAQItem[] }> {
        return this._get('/api/faqs');
    }

    // 开始客服会话
    startCustomerService(userId: string): Promise<{ data: { sessionId: string } }> {
        return this._post('/api/customer-service/start', { userId });
    }
}

const customerServiceApi = new CustomerServiceApi();

export default customerServiceApi;